@/* 框架顶部 */
<link rel="stylesheet" href="${ctxPath}/assets/common/css/header.css?v=${constants.getReleaseVersion()}">
<style>
    .layui-layer-shade{
        z-index: 1!important;
        background-color: rgb(0, 0, 0);
        opacity: 0.3;
    }
    .gx_time{
        color: #999;
        font-weight: 500;
        float: right;
        padding-right: 10px
    }
    ol{list-style-type:none;
        counter-reset:sectioncounter;
        padding-left: 15px;
        margin-left: 20px;
        /*text-indent: -20px;*/
    }
    .layui-layer-admin{
        z-index: 19891015;
        width: 360px;
        position: fixed!important;
        top: 15px;
    }
</style>
<div class="layui-header">
    <div id="id" hidden>
        <div style="flex-direction: row">
            <span style="padding-left: 10px" id="update_cont"></span>

            <span class="gx_time"><span id="update_time"></span>更新</span>
        </div>
        <div class="layui-col-sm12" style="padding: 10px 20px;">
            <ol id="tip_ol">
            </ol>
        </div>
    </div>
    <div class="layui-logo">
        <!--<img src="${ctxPath}/assets/common/images/logo.png"/>-->
<!--        <i class="layui-icon layui-icon-component"></i>-->
        <span class="logo">
            <em>妖</em>
        </span>
        <cite>
            <strong>${constants.getSystemName()}</strong>
        </cite>
    </div>
    <ul class="layui-nav layui-layout-left" >
        <li class="layui-nav-item" lay-unselect>
            <a ew-event="flexible" title="侧边伸缩"><i class="layui-icon layui-icon-shrink-right"></i></a>
        </li>
        <li class="layui-nav-item" lay-unselect>
            <a ew-event="refresh" title="刷新"><i class="layui-icon layui-icon-refresh-3"></i></a>
        </li>

        @var types = shiro.getUser().systemTypes;
        @if(tool.isNotEmpty(types)){
        @for(type in types) {
        @if(typeLP.index == 1){
        <li class="layui-nav-item  layui-this" lay-unselect><a nav-bind="${type.code}">${type.name}</a></li>
        @}else{
        <li class="layui-nav-item " lay-unselect><a nav-bind="${type.code}">${type.name}</a></li>
        @}
        @}
        @}

    </ul>
    <ul class="layui-nav layui-layout-right">
<!--        <li class="layui-nav-item" lay-unselect>-->
<!--            <a ew-event="message" title="消息"><i class="layui-icon layui-icon-notice"></i></a>-->
<!--        </li>-->
<!--        <li class="layui-nav-item layui-hide-xs" lay-unselect>-->
<!--            <a ew-event="fullScreen" title="全屏"><i class="layui-icon layui-icon-screen-full"></i></a>-->
<!--        </li>-->
        <li class="layui-nav-item" lay-unselect id="version">
            <a id="bb">切换版本</a>
        </li>
        <li class="layui-nav-item" lay-unselect>
            <a style="padding-right: 10px">
                <!--<img src="${avatar!}" class="layui-nav-img">-->
                <strong>
                    ${name!"用户"}
                </strong>
                <i class="layui-icon layui-icon-more-vertical"></i>
            </a>
            <dl class="layui-nav-child" style="left: -15px">
                <dd lay-unselect>
                    <a ew-href="${ctxPath}/system/user_info">个人信息</a>
                </dd>
                <dd lay-unselect>
                    <a id="setPsw">修改密码</a>
                </dd>
                <dd lay-unselect>
                    <a ew-event="theme" title="主题">切换主题</a>
                </dd>
                <dd lay-unselect>
                    <a id="tip">版本更新</a>
                </dd>
                <hr>
                <dd lay-unselect>
                    <a id="btnLogout">退出</a>
                </dd>
            </dl>
        </li>
        <!--<li class="layui-nav-item" lay-unselect>-->
            <!--<a ew-event="theme" title="主题"><i class="layui-icon layui-icon-more-vertical"></i></a>-->
        <!--</li>-->
    </ul>
</div>


<script>

    // leez add start
    var _windowIsSizing = false

    function handleSidebarDisplay() { // 控制侧边显示
        var _windowClientWidth = document.body.clientWidth
        if(_windowClientWidth <= 1380 && _windowClientWidth >= 770) {
            document.querySelector('.layui-layout-admin').classList.add('admin-nav-mini')
        } else {
            document.querySelector('.layui-layout-admin').classList.remove('admin-nav-mini')
        }
    }

    function _reloadTable() {
        if(_windowIsSizing) return
        _windowIsSizing = true
        handleSidebarDisplay()
        setTimeout(() => {
            _windowIsSizing = false
        }, 10)
    }

    handleSidebarDisplay()

    window.onresize = function(){
        _reloadTable()
    };


    // leez add end
</script>